package com.zjut.an.user.manager;

import java.util.List;

import javax.annotation.Resource;

import com.zjut.an.user.dao.AnUser;
import com.zjut.an.user.dao.AnUserDAO;
import com.zjut.an.util.module.PageModule;


public class AnUserManager {

	@Resource(name = "AnUserDAO")
	private AnUserDAO dao;
	
	public void addData(AnUser obj) {	
		dao.save(obj);
	}
	
	public void updateData(AnUser obj) {
		dao.update(obj);
	}
	
	public void deleteData(AnUser obj) {
		dao.delete(obj);
	}

	public void deleteDatas(List<AnUser> objlist) {
		for (AnUser AnUser : objlist) {
			dao.delete(AnUser);
		}
	}
	
	public PageModule getDataByInstance (int pageNumber,int pageSize, String sort, String order,AnUser obj) {
		return dao.findByInstance(pageNumber, pageSize, sort, order, obj);
	}
	
	public List getDatas() {
		return dao.findAll();
	}

	public AnUser getData(int objId) {
		return dao.findById(objId);
	}
}
